package com.cdzy.mapper;

import com.cdzy.pojo.Book;
import com.cdzy.pojo.BookType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface BookMapper {
    // 获取书籍分类列表
    List<BookType> selectBookTypeList();

    // 查找书籍列表
    List<Book> getBookListByType(Book book);

    @Select("select * from books")
    List<Book> getBookList();

    @Select("select count(*) from books")
    int selectBookListCount();

    void insert(Book books);

    void update(Book books);

    boolean deleteById(Integer bookId);

    Book queryById(Integer bookId);
}